home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #14 / Monster Media No. 14 (April 1996) (Monster Media, Inc.).ISO / prog_bas / easynet.zip / DEMO.ZIP / FLOWCHAR.FRM < prev    next >
Text File  |  1996-01-01  |  9KB  |  333 lines

  1. VERSION 4.00
  2. Begin VB.Form Form4 
  3.    Appearance      =   0  'Flat
  4.    BackColor       =   &H00FFFFFF&
  5.    Caption         =   "Example 4: FlowChart"
  6.    ClientHeight    =   4155
  7.    ClientLeft      =   1095
  8.    ClientTop       =   1485
  9.    ClientWidth     =   7365
  10.    DrawStyle       =   5  'Transparent
  11.    BeginProperty Font 
  12.       name            =   "MS Sans Serif"
  13.       charset         =   1
  14.       weight          =   700
  15.       size            =   8.25
  16.       underline       =   0   'False
  17.       italic          =   0   'False
  18.       strikethrough   =   0   'False
  19.    EndProperty
  20.    ForeColor       =   &H000000C0&
  21.    Height          =   4560
  22.    Left            =   1035
  23.    LinkTopic       =   "Form4"
  24.    MDIChild        =   -1  'True
  25.    ScaleHeight     =   4155
  26.    ScaleWidth      =   7365
  27.    Tag             =   "4"
  28.    Top             =   1140
  29.    Width           =   7485
  30.    Begin VB.PictureBox Picture1 
  31.       Appearance      =   0  'Flat
  32.       AutoSize        =   -1  'True
  33.       BackColor       =   &H80000005&
  34.       ForeColor       =   &H80000008&
  35.       Height          =   930
  36.       Index           =   3
  37.       Left            =   4500
  38.       Picture         =   "FLOWCHAR.frx":0000
  39.       ScaleHeight     =   900
  40.       ScaleWidth      =   900
  41.       TabIndex        =   4
  42.       Top             =   3030
  43.       Visible         =   0   'False
  44.       Width           =   930
  45.    End
  46.    Begin VB.PictureBox Picture1 
  47.       Appearance      =   0  'Flat
  48.       AutoSize        =   -1  'True
  49.       BackColor       =   &H80000005&
  50.       ForeColor       =   &H80000008&
  51.       Height          =   930
  52.       Index           =   2
  53.       Left            =   4500
  54.       Picture         =   "FLOWCHAR.frx":0802
  55.       ScaleHeight     =   900
  56.       ScaleWidth      =   900
  57.       TabIndex        =   3
  58.       Top             =   2070
  59.       Visible         =   0   'False
  60.       Width           =   930
  61.    End
  62.    Begin VB.PictureBox Picture1 
  63.       Appearance      =   0  'Flat
  64.       AutoSize        =   -1  'True
  65.       BackColor       =   &H80000005&
  66.       ForeColor       =   &H80000008&
  67.       Height          =   930
  68.       Index           =   1
  69.       Left            =   4500
  70.       Picture         =   "FLOWCHAR.frx":1004
  71.       ScaleHeight     =   900
  72.       ScaleWidth      =   900
  73.       TabIndex        =   2
  74.       Top             =   1110
  75.       Visible         =   0   'False
  76.       Width           =   930
  77.    End
  78.    Begin VB.PictureBox Picture1 
  79.       Appearance      =   0  'Flat
  80.       AutoSize        =   -1  'True
  81.       BackColor       =   &H80000005&
  82.       ForeColor       =   &H80000008&
  83.       Height          =   930
  84.       Index           =   0
  85.       Left            =   4500
  86.       Picture         =   "FLOWCHAR.frx":1806
  87.       ScaleHeight     =   900
  88.       ScaleWidth      =   900
  89.       TabIndex        =   1
  90.       Top             =   150
  91.       Visible         =   0   'False
  92.       Width           =   930
  93.    End
  94.    Begin VBX.EasyNet Net1 
  95.       Alignment       =   7  'Center - MIDDLE
  96.       AutoScroll      =   -1  'True
  97.       AutoSize        =   2  'Adjust Node Size to Picture
  98.       BackColor       =   &H00FFFFFF&
  99.       DrawColor       =   &H00000000&
  100.       DrawStyle       =   5  'Transparent
  101.       DrawWidth       =   1
  102.       FillColor       =   &H00F8FCF8&
  103.       FontBold        =   0   'False
  104.       FontItalic      =   0   'False
  105.       FontName        =   "MS Sans Serif"
  106.       FontSize        =   8.25
  107.       FontStrikethru  =   0   'False
  108.       FontUnderline   =   0   'False
  109.       ForeColor       =   &H000000C0&
  110.       Height          =   3795
  111.       Hiding          =   0   'False
  112.       ImageFile       =   ""
  113.       Left            =   240
  114.       License         =   "FLOWCHAR.frx":2008
  115.       LinkHead        =   7  'Empty Arrow 45
  116.       MultiSel        =   -1  'True
  117.       ScrollBars      =   3  'Both
  118.       Shape           =   1  'Rectangle
  119.       TabIndex        =   0
  120.       Top             =   180
  121.       Transparent     =   -1  'True
  122.       Version         =   183
  123.       Width           =   4065
  124.       xGrid           =   15
  125.       yGrid           =   15
  126.    End
  127. End
  128. Attribute VB_Name = "Form4"
  129. Attribute VB_Creatable = False
  130. Attribute VB_Exposed = False
  131.  
  132. Private Sub banner4()
  133.   Dim idLink2&, idLink1&
  134.  
  135.   ' Draw transparent except for links (see AddLink event)
  136.   Net1.DrawStyle = 5
  137.  
  138.   ' Create nodes
  139.   Net1.EditAction = 0
  140.   Net1.X1 = 200
  141.   Net1.Y1 = 200
  142.   Net1.ForeColor = RGB(0, 0, 0)
  143.   Net1.Text = "BEGIN"
  144.   Net1.Picture = Picture1(1).Picture
  145.   Net1.Shape = 1
  146.   Net1.Type = 1
  147.   Net1.Org = Net1.Item
  148.  
  149.   Net1.EditAction = 0
  150.   Net1.X1 = 200
  151.   Net1.Y1 = 2200
  152.   Net1.Text = "STEP1"
  153.   Net1.Picture = Picture1(0).Picture
  154.   Net1.Type = 0
  155.   Net1.Dst = Net1.Item
  156.  
  157.   Net1.EditAction = 1
  158.   Net1.Org = Net1.Dst
  159.  
  160.   Net1.EditAction = 0
  161.   Net1.X1 = 2200
  162.   Net1.Y1 = 2200
  163.   Net1.Text = "Success?"
  164.   Net1.Picture = Picture1(2).Picture
  165.   Net1.Shape = 3
  166.   Net1.Type = 2
  167.   Net1.Dst = Net1.Item
  168.  
  169.   Net1.EditAction = 1
  170.   Net1.Org = Net1.Dst
  171.  
  172.   Net1.EditAction = 0
  173.   Net1.X1 = 4200
  174.   Net1.Y1 = 1000
  175.   Net1.Text = "STEP3"
  176.   Net1.Picture = Picture1(0).Picture
  177.   Net1.Type = 0
  178.   Net1.Dst = Net1.Item
  179.  
  180.   Net1.EditAction = 1
  181.   Net1.PointCount = 1
  182.   Net1.PointX(0) = 2640
  183.   Net1.PointY(0) = 1440
  184.   Net1.Text = "YES"
  185.   idLink1 = Net1.Item
  186.  
  187.   Net1.EditAction = 0
  188.   Net1.X1 = 4200
  189.   Net1.Y1 = 3400
  190.   Net1.Text = "STEP2"
  191.   Net1.Shape = 0
  192.   Net1.Picture = Picture1(3).Picture
  193.   Net1.Type = 3
  194.   Net1.Dst = Net1.Item
  195.  
  196.   Net1.EditAction = 1
  197.   Net1.PointCount = 1
  198.   Net1.PointX(0) = 2640
  199.   Net1.PointY(0) = 3840
  200.   Net1.Text = "NO"
  201.   Net1.ForeColor = RGB(0, 255, 0)
  202.   Net1.LinkHead = 6
  203.   idLink2 = Net1.Item
  204.  
  205.   Net1.EditAction = 0
  206.   Net1.X1 = 6200
  207.   Net1.Y1 = 2200
  208.   Net1.Text = "END"
  209.   Net1.ForeColor = RGB(0, 0, 0)
  210.   Net1.Picture = Picture1(1).Picture
  211.   Net1.Shape = 1
  212.   Net1.Type = 1
  213.   Net1.Dst = Net1.Item
  214.  
  215.   Net1.Item = idLink1
  216.   Net1.Org = Net1.Dst
  217.   Net1.EditAction = 1
  218.   Net1.PointCount = 1
  219.   Net1.PointX(0) = 6625
  220.   Net1.PointY(0) = 1440
  221.  
  222.   Net1.Item = idLink2
  223.   Net1.Org = Net1.Dst
  224.   Net1.EditAction = 1
  225.   Net1.PointCount = 1
  226.   Net1.PointX(0) = 6625
  227.   Net1.PointY(0) = 3840
  228.   Net1.LinkHead = 6
  229.  
  230.   Net1.Item = 0
  231. End Sub
  232.  
  233. Private Sub Form_Activate()
  234.   ActivateForm
  235. End Sub
  236.  
  237. Private Sub Form_Deactivate()
  238.   DeactivateForm
  239. End Sub
  240.  
  241. Private Sub Form_Load()
  242.   MDI1.ShowExample(3).Enabled = False
  243.  
  244.   SpeedON Net1
  245.  
  246.   banner4
  247.  
  248.   SpeedOFF Net1
  249. End Sub
  250.  
  251. Private Sub Form_Resize()
  252.   If WindowState <> 1 And ScaleHeight <> 0 Then
  253.     Net1.Visible = False
  254.     Net1.Top = 0
  255.     Net1.Left = 0
  256.     Net1.Height = ScaleHeight
  257.     Net1.Width = ScaleWidth
  258.     Net1.Visible = True
  259.   End If
  260. End Sub
  261.  
  262. Private Sub Form_Unload(Cancel As Integer)
  263.   MDI1.ShowExample(3).Enabled = True
  264.   MDI1.Command5.Enabled = False
  265.   MDI1.Command5.Caption = "Comments "
  266. End Sub
  267.  
  268. Private Sub Net1_AddLink()
  269.   Net1.DrawStyle = 6
  270.   Net1.ForeColor = RGB(0, 0, 255)
  271. End Sub
  272.  
  273. Private Sub Net1_AddNode()
  274.   Net1.Picture = Picture1(0).Picture
  275. End Sub
  276.  
  277. Private Sub Net1_DblClick()
  278.   If Net1.Item <> 0 Then
  279.     If Net1.IsLink = False Then
  280.       Legend = Net1.Text
  281.       Picnum = Net1.Type
  282.       AutoSize = Net1.AutoSize
  283.       AlignMent = Net1.AlignMent
  284.       frmLegend.Show 1
  285.       If Ok Then
  286.         Net1.Text = Legend
  287.         Net1.Type = Picnum
  288.         Net1.AutoSize = AutoSize
  289.         Net1.AlignMent = AlignMent
  290.         Net1.Picture = Picture1(Picnum).Picture
  291.  
  292.         'Choose a shape that is near picture shape
  293.         Select Case Picnum
  294.         Case 0   ' Rectangle
  295.           Net1.Shape = 1
  296.         Case 1
  297.           Net1.Shape = 2
  298.         Case 2
  299.           Net1.Shape = 3
  300.         Case 3
  301.           Net1.Shape = 0
  302.         End Select
  303.       End If
  304.     End If
  305.   End If
  306. End Sub
  307.  
  308. Private Sub Net1_KeyDown(KeyCode As Integer, Shift As Integer)
  309.   Dim l&
  310.  
  311.   Select Case KeyCode
  312.   Case KEY_DELETE
  313.     Net1.EditAction = 2
  314.   Case KEY_LEFT
  315.     l = SendMessage(Net1.hWnd, WM_HSCROLL, SB_LINEUP, 0)
  316.   Case KEY_RIGHT
  317.     l = SendMessage(Net1.hWnd, WM_HSCROLL, SB_LINEDOWN, 0)
  318.   Case KEY_DOWN
  319.     l = SendMessage(Net1.hWnd, WM_VSCROLL, SB_LINEDOWN, 0)
  320.   Case KEY_UP
  321.     l = SendMessage(Net1.hWnd, WM_VSCROLL, SB_LINEUP, 0)
  322.   Case KEY_NEXT
  323.     l = SendMessage(Net1.hWnd, WM_VSCROLL, SB_PAGEDOWN, 0)
  324.   Case KEY_PRIOR
  325.     l = SendMessage(Net1.hWnd, WM_VSCROLL, SB_PAGEUP, 0)
  326.   End Select
  327. End Sub
  328.  
  329. Private Sub Net1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  330.   CursorShape Net1
  331. End Sub
  332.  
  333.